package cn.etgps.etgps.base;

import android.app.Activity;

import java.util.HashMap;

import cn.etgps.etgps.api.AppHttpApi;
import cn.etgps.etgps.core.AppApiFactory;
import cn.etgps.etgps.utils.Constant;
import cn.etgps.etgps.utils.SharedPreferencesUtils;

/**
 * Created by itte on 2016/3/28.
 */
public abstract class BasePresenter<Iview extends BaseIView> {
    public static final AppHttpApi httpApi = AppApiFactory.getApiInstance();//api
    protected Iview iView;
    protected Activity mContext;
    protected String userId;
    protected String userType;
    protected SharedPreferencesUtils sharedPreferencesUtils;
    protected HashMap<String, String> getParams;//get请求参数
    protected HashMap<String, String> postParams;//post参数

    public BasePresenter(Activity context, Iview view) {
        this.iView = view;
        this.mContext = context;
        sharedPreferencesUtils = SharedPreferencesUtils.getInstance(mContext);
        userId = sharedPreferencesUtils.getStrShareData(Constant.USER_ID);
        userType = sharedPreferencesUtils.getStrShareData(Constant.USER_TYPE);
    }
}
